$(document).ready(function () {
    require.config({
        baseUrl: ctx + '/resource/plugins/echarts4',
        paths: {
            echarts: 'echarts',
            dark: 'theme/dark',

        }
    });
    require(
        [
            'echarts',
            'dark'

        ],
        function (ec) {


            left_top_echart1 = ec.init(document.getElementById('left_top_echart1'));//健康度
            queryTotalHealth();
            center_echart = ec.init(document.getElementById('center_echart'),'dark');//资源使用情况
            queryResourceUseOverview();
            down_right_echart= ec.init(document.getElementById('down_right_echart'),'dark');//24小时告警
            alarmTendencyContrast();
            center_right_echart= ec.init(document.getElementById('center_right_echart'),'dark');//巡检视图
            queryInspectOverviews();
            setTimeout(function () {
                window.onresize = function () {

                    left_top_echart1.resize();
                    center_echart.resize();
                    down_right_echart.resize();
                    center_right_echart.resize();
                }
            }, 200)
        }
    );
    queryPlatformHealth();
    queryBusinessHealth();
    queryResourceClassOverview();
    queryPlatformAngle();
    queryInspectOverview();
});


/**平台分类*/
function queryPlatformHealth() {
    url = ctx + "/KpiOverview/queryPlatformHealth";
    $.ajax({
        url: url,
        type: "post",
        success: function (data) {
            var overview = JSON.parse(data);
            var plist = overview.plist;
            var tableStr2 = "";
            var tableStr3 = "";
            if (plist.length > 0) {
                for (var i = 0; i < plist.length; i++) {
                    var health_status="";
                    if(plist[i].HEALTH_STATUS=='健康'){
                        health_status="attr jiankang";
                    }else if(plist[i].HEALTH_STATUS=='亚健康'){
                        health_status="attr yajiankang";
                    }else if(plist[i].HEALTH_STATUS=='不健康'){
                        health_status="attr bujiankang";
                    }
                    if (i < 8) {
                        tableStr2 += "<tr><td title='"+plist[i].KBP_CAPTION+"'><span>"+ plist[i].KBP_CAPTION +"</span></td>";
                        tableStr2 += "<td><span>"+ plist[i].SCORE +"</span></td>";
                        tableStr2 += "<td class='"+health_status+"'><span>" + plist[i].HEALTH_STATUS + "</span></td></tr>";
                    } else {
                        tableStr3 += "<tr><td title='"+plist[i].KBP_CAPTION+"'><span>"+ plist[i].KBP_CAPTION +"</span></td>";
                        tableStr3 += "<td><span>"+ plist[i].SCORE +"</span></td>";
                        tableStr3 += "<td class='"+health_status+"'><span>" + plist[i].HEALTH_STATUS + "</span></td></tr>";

                    }
                }

            }
            $("#tb6").append(tableStr2);
            $("#tb7").append(tableStr3);
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });

}

/**业务分类*/
function queryBusinessHealth() {
    url = ctx + "/KpiOverview/queryBusinessHealth";
    $.ajax({
        url: url,
        type: "post",
        success: function (data) {
            var overview = JSON.parse(data);
            var blist = overview.blist;
            var tableStr = "";
            var tableStr1 = "";
            if (blist.length > 0) {
                for (var i = 0; i < blist.length; i++) {
                    var health_status="";
                    if(blist[i].HEALTH_STATUS=='健康'){
                        health_status="attr jiankang";
                    }else if(blist[i].HEALTH_STATUS=='亚健康'){
                        health_status="attr yajiankang";
                    }else if(blist[i].HEALTH_STATUS=='不健康'){
                        health_status="attr bujiankang";
                    }
                    if (i < 8) {
                        tableStr += "<tr><td title='"+blist[i].KBP_CAPTION+"'><span>"+ blist[i].KBP_CAPTION +"</span></td>";
                        tableStr += "<td><span>"+ blist[i].SCORE +"</span></td>";
                        tableStr += "<td class='"+health_status+"'><span>" + blist[i].HEALTH_STATUS + "</span></td></tr>";
                    } else {
                        tableStr1 += "<tr><td title='"+blist[i].KBP_CAPTION+"'><span>"+ blist[i].KBP_CAPTION +"</span></td>";
                        tableStr1 += "<td><span>"+ blist[i].SCORE +"</span></td>";
                        tableStr1 += "<td class='"+health_status+"'><span>" + blist[i].HEALTH_STATUS + "</span></td></tr>";

                    }
                }

            }
            $("#tb4").append(tableStr);
            $("#tb5").append(tableStr1);
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}

function queryTotalHealth() {
    url = ctx + "/KpiOverview/queryTotalHealth";
    $.ajax({
        url: url,
        type: "post",
        success: function (data) {
            var overview = JSON.parse(data);
            var tlist = overview.tlist;
            var y1data = [];
            var y2data = [];
            var y3data = [];
            var text_health="";
            var text_color="";
            if(tlist[0].HEALTH_STATUS=="健康"){
                text_color="#40AB1B";
            }else if(tlist[0].HEALTH_STATUS=="亚健康"){
                text_color="#3971D8";
            }else if(tlist[0].HEALTH_STATUS=="不健康"){
                text_color="#D44343";
            }
            text_health+="<span style='font-size: 20px;color: #121212'>系统总体健康度：</span>" ;
            text_health+="<span style='font-size: 25px;margin-right: 5%;color: "+text_color+"'>"+tlist[0].TOTAL_SCORE+"</span>" ;
            text_health+="<span style='font-size: 20px;color:#121212'>系统状态：</span>";
            text_health+="<span style='font-size: 25px;color:"+text_color+"'>"+tlist[0].HEALTH_STATUS+"</span>";
            $("#text_health").append(text_health);
            /*$("#jk").html("系统总体健康度:" + tlist[0].TOTAL_SCORE);
            $("#zt").html("系统状态:" + tlist[0].HEALTH_STATUS);*/
            y1data.push({name: "总体健康度", value: tlist[0].TOTAL_SCORE});
            y2data.push({name: "业务健康度", value: tlist[0].YW_SCORE});
            y3data.push({name: "平台健康度", value: tlist[0].PT_SCORE});
            option = {
                tooltip: {
                    formatter: "{b}:{c}%"
                },
                series: [
                    {
                        type: 'gauge',
                        radius: '60%',
                        center : ['50%', '45%'],
                        axisLine: {            // 坐标轴线
                            lineStyle: {       // 属性lineStyle控制线条样式
                                color: [[0.6, '#ff4500'], [0.8, '#1e90ff'], [1, 'lime']],
                                width: 2,
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        axisLabel: {            // 坐标轴小标记
                            textStyle: {       // 属性lineStyle控制线条样式
                                fontWeight: 'bolder',
                                color: '#050505',
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        axisTick: {            // 坐标轴小标记
                            length: 12,        // 属性length控制线长
                            lineStyle: {       // 属性lineStyle控制线条样式
                                color: 'auto',
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        splitLine: {           // 分隔线
                            length: 20,         // 属性length控制线长
                            lineStyle: {       // 属性lineStyle（详见lineStyle）控制线条样式
                                width: 3,
                                color: 'auto',
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        pointer: {           // 分隔线
                            shadowColor: '#fff', //默认透明
                            shadowBlur: 5
                        },
                        title: {
                            offsetCenter: [0, -34,'50%'],
                            textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                                fontWeight: 'bolder',
                                fontSize: 12,
                                color: '#050505',
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        detail: {
                            formatter: '{value}',
                            offsetCenter: [0, 64,'50%'],
                            textStyle: {
                                fontSize: 24
                            }
                        },

                        data: y1data
                    },
                    {
                        type: 'gauge',
                        radius: '50%',
                        center: ['17%', '50%'],
                        axisLine: {            // 坐标轴线
                            lineStyle: {       // 属性lineStyle控制线条样式
                                color: [[0.6, '#ff4500'], [0.8, '#1e90ff'], [1, 'lime']],
                                width: 2,
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        axisLabel: {            // 坐标轴小标记
                            textStyle: {       // 属性lineStyle控制线条样式
                                fontWeight: 'bolder',
                                color: '#050505',
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        axisTick: {            // 坐标轴小标记
                            length: 15,        // 属性length控制线长
                            lineStyle: {       // 属性lineStyle控制线条样式
                                color: 'auto',
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 15
                            }
                        },
                        splitLine: {           // 分隔线
                            length: 20,         // 属性length控制线长
                            lineStyle: {       // 属性lineStyle（详见lineStyle）控制线条样式
                                width: 3,
                                color: 'auto',
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        pointer: {           // 分隔线
                            shadowColor: '#fff', //默认透明
                            shadowBlur: 5
                        },
                        title: {
                            offsetCenter: [0, -26,'50%'],
                            textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                                fontWeight: 'bolder',
                                fontSize: 10,
                                color: '#050505',
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        detail: {
                            formatter: '{value}',
                            offsetCenter: [0, 54,'50%'],
                            textStyle: {
                                fontSize: 22
                            }
                        },

                        data: y2data
                    },
                    {
                        type: 'gauge',
                        radius: '50%',
                        center: ['83%', '50%'],
                        axisLine: {            // 坐标轴线
                            lineStyle: {       // 属性lineStyle控制线条样式
                                color: [[0.6, '#ff4500'], [0.8, '#1e90ff'], [1, 'lime']],
                                width: 2,
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        axisLabel: {            // 坐标轴小标记
                            textStyle: {       // 属性lineStyle控制线条样式
                                fontWeight: 'bolder',
                                color: '#050505',
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        axisTick: {            // 坐标轴小标记
                            length: 15,        // 属性length控制线长
                            lineStyle: {       // 属性lineStyle控制线条样式
                                color: 'auto',
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 15
                            }
                        },
                        splitLine: {           // 分隔线
                            length: 20,         // 属性length控制线长
                            lineStyle: {       // 属性lineStyle（详见lineStyle）控制线条样式
                                width: 3,
                                color: 'auto',
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        pointer: {           // 分隔线
                            shadowColor: '#fff', //默认透明
                            shadowBlur: 5
                        },
                        title: {
                            offsetCenter: [0, -26,'50%'],
                            textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                                fontWeight: 'bolder',
                                fontSize: 10,
                                color: '#050505',
                                shadowColor: '#fff', //默认透明
                                shadowBlur: 10
                            }
                        },
                        detail: {
                            formatter: '{value}',
                            offsetCenter: [0, 54,'50%'],
                            textStyle: {
                                fontSize: 22
                            }
                        },

                        data: y3data
                    },
                ]
            };
            left_top_echart1.setOption(option);

        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}

function queryResourceClassOverview() {

    url = ctx + "/KpiOverview/queryResourceClassOverview";
    $.ajax({
        url: url,
        type: "post",
        success: function (data) {
            var overview = JSON.parse(data);
            var count = overview.count;
            var list=overview.list;
            var tableStr="";
            $("#zs").html(count[0].TOTAL);
            $("#zy").html(count[0].TRANSIT);
            $("#sy").html(count[0].SURPLUS);
            $("#syl").html(count[0].P);
            if (list.length > 0) {
                for (var i = 0; i < 8; i++) {
                    tableStr += "<tr><td title='"+list[i].RESOURCEUSE+"'><span>" + list[i].RESOURCEUSE + "</span></td>";
                    tableStr += "<td><span>" + list[i].ALLNUM + "</span></td>";
                    tableStr += "<td><span>" + list[i].ZAIYUNNUM + "</span></td>";
                    tableStr += "<td><span>" + list[i].SHENGYUNUM + "</span></td>";
                    tableStr += "<td><span>" + list[i].P + "</span></td></tr>";
                }

            }

            $("#tb8").append(tableStr);


        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}
function queryResourceUseOverview(){
    url = ctx + "/KpiOverview/queryResourceUseOverview";
    $.ajax({
        url: url,
        type: "post",
        success: function (data) {

            var overview = JSON.parse(data);
            var xdata = [];
            var y1data = [];
            var y2data = [];
            var y3data = [];
            var y4data = [];
            for (var i = 0; i < overview.length; i++) {
                xdata.push(overview[i].RESOURCEUSE);
                y1data.push(overview[i].ZAIYUNNUM);
                y2data.push(overview[i].SHENGYUNUM);
                y3data.push(overview[i].ALLNUM);
                y4data.push(overview[i].P);
            }

            option = {
                backgroundColor: '#fff',//背景色
                tooltip: {
                    trigger: 'axis',
                    axisPointer : {
                        type : 'shadow'
                    },
                    formatter: function (params) {
                        return params[0].name + '<br/>'
                            + '总数量:' + params[0].value + '<br/>'
                            + '在用数:' + params[1].value + '<br/>'
                            + '剩余数:' + params[2].value + '<br/>'
                            + '使用率:' + parseFloat((params[3].value).toPrecision(12)) + '%';
                    }
                },
                /*title: {
                    text: '资源分类使用情况',
                    x: 'center',
                    textStyle: {
                        color: '#AAAAAA'
                    }
                },*/
                toolbox: {
                    show: false,
                },
                grid: {
                    x: '10%',
                    y: '15%',
                    x2: '10%',
                    y2: '15%',
                    borderWidth: 0,
                },
                calculable: true,
                legend: {
                    data: ['总数量','在用数', '剩余数', '使用率'],
                    /*x: 'center',
                    y: 'bottom',*/
                    textStyle: {
                        color: '#AAAAAA'
                    }
                },
                xAxis: [
                    {
                        type: 'category',
                        splitLine: {
                            show: false,
                        },
                        axisLabel: {
                            show: true,
                            interval: 0,
                            rotate: -30,
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: xdata
                    }
                ],
                yAxis: [
                    {
                        type: 'value',
                        splitLine: {
                            show: true,
                        },
                        name: '数量(个)',
                        axisLabel: {
                            formatter: '{value} ',
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        nameTextStyle: {
                            color: '#AAAAAA'
                        }
                    },

                    {
                        type: 'value',
                        splitLine: {
                            show: false,
                        },
                        name: '使用率(%)',
                        axisLabel: {
                            formatter: '{value}%',
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        nameTextStyle: {
                            color: '#AAAAAA'
                        }
                    }
                ],
                series: [
                    {
                        name: '总数量',
                        type: 'bar',
                        label: {
                            normal: {
                                show: false,
                                position: 'insideRight'
                            }
                        },
                        color: '#458B74',
                        data: y3data
                    },
                    {
                        name: '在用数',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: false,
                                position: 'insideRight'
                            }
                        },
                        color: '#00C5CD',
                        data: y1data
                    },
                    {
                        name: '剩余数',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: false,
                                position: 'insideRight'
                            }
                        },
                        color: '#C6E2FF',
                        data: y2data
                    },
                    {
                        name: '使用率',
                        type: 'line',
                        yAxisIndex: 1,
                        data: y4data,
                        color: '#EE7600'
                    }
                ]
            };


            center_echart.setOption(option);

        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });

}
function queryPlatformAngle(){
    url=ctx+"/KpiOverview/queryMonitorKpiCount";
    $.ajax({
        url:url,
        type:"post",
        success:function(data){
            var overview =JSON.parse(data);
            var tableStr="";
            var tableStr1="";
            var count=overview.list;
            overview=overview.mlist;
            $("#jkzb").html(count[0].KPI_COUNT);
            $("#yzgj").html(count[0].YZGJ_COUNT);
            $("#zygj").html(count[0].ZYGJ_COUNT);
            $("#ybgj").html(count[0].YBGJ_COUNT);
            $("#hdgj").html(count[0].HDGJ_COUNT);
            $("#yxcgj").html(count[0].YXCGJ_COUNT);
            for(var i=0;i<overview.length;i++){
                if(i<8){
                    tableStr += "<tr><td title='"+overview[i].KBP_CAPTION+"'><span>" + overview[i].KBP_CAPTION + "</span></td>";
                    tableStr += "<td><span>" + overview[i].YZGJ + "</span></td>";
                    tableStr += "<td><span>" + overview[i].ZYGJ+ "</span></td>";
                    tableStr += "<td><span>" + overview[i].YBGJ+ "</span></td></tr>";

                }else{
                    tableStr1 += "<tr><td title='"+overview[i].KBP_CAPTION+"'><span>" + overview[i].KBP_CAPTION + "</span></td>";
                    tableStr1 += "<td><span>" + overview[i].YZGJ + "</span></td>";
                    tableStr1 += "<td><span>" + overview[i].ZYGJ+ "</span></td>";
                    tableStr1 += "<td><span>" + overview[i].YBGJ+ "</span></td></tr>";
                }

            }
            $("#on").append(tableStr);
            $("#off").append(tableStr1);
        },error:function(textStatus){
            console.log("error:"+textStatus.status);
        }
    });
}
function alarmTendencyContrast(){
    url=ctx+"/KpiOverview/alarmTendencyContrast";
    $.ajax({
        url:url,
        type:"post",
        success:function(data){
            var overview =JSON.parse(data);
            var xdata=[];
            var ydata1=[];
            var ydata2=[];
            var ydata3=[];
            overview=overview.list;
            console.log(overview);
            for(var i=0;i<overview.length;i++){

                xdata.push(overview[i].hour);
                ydata1.push(overview[i].yz_count);
                ydata2.push(overview[i].zy_count);
                ydata3.push(overview[i].yb_count);
            }
            option = {
                backgroundColor: '#fff',//背景色
                /*title: {
                    text: '最近24小时告警趋势',
                    textStyle: {
                        color: '#AAAAAA'
                    }
                },*/
                tooltip : {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'cross',
                        label: {
                            backgroundColor: '#6a7985'
                        }
                    }
                },
                legend: {
                    top:'15',
                    data:['严重告警','重要告警','一般告警'],
                    textStyle: {
                        color: '#AAAAAA'
                    }
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis : [
                    {
                        type : 'category',
                        boundaryGap : false,
                        axisLabel: {
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data : xdata
                    }
                ],
                yAxis : [
                    {
                        type : 'value',
                        axisLabel: {
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    }
                ],
                series : [
                    {
                        name:'严重告警',
                        type:'line',
                        color:'#EE5C42',
                        /*stack: '总量',*/
                        areaStyle: {normal: {}},
                        data:ydata1
                    },
                    {
                        name:'重要告警',
                        type:'line',
                        color:'#4876FF',
                        /*stack: '总量',*/
                        areaStyle: {normal: {}},
                        data:ydata2
                    },
                    {
                        name:'一般告警',
                        type:'line',
                        color:'#FFC125',
                        /*stack: '总量',*/
                        areaStyle: {normal: {}},
                        data:ydata3
                    }
                ]
            };
            down_right_echart.setOption(option);
        },error:function(textStatus){
            console.log("error:"+textStatus.status);
        }
    });
}

function queryInspectOverview(){

        url = ctx + "/KpiOverview/queryInspectOverview";
        $.ajax({
            url: url,
            type: "post",
            success: function (data) {

                var overview = JSON.parse(data);
                var allNum=overview.allNum;
                var list=overview.tableData;
                var tableStr="";
                $("#xjrw").html(allNum[0].ALL_COUNT);
                $("#rwcg").html(allNum[0].SUCCESS_COUNT);
                $("#rwsb").html(allNum[0].FAIL_COUNT);
                if (list.length > 0) {
                    for (var i = 0; i < 8; i++) {
                        var health_status="";
                        if(list[i].HEALTH_STATUS=='健康'){
                            health_status="attr jiankang";
                        }else if(list[i].HEALTH_STATUS=='亚健康'){
                            health_status="attr yajiankang";
                        }else if(list[i].HEALTH_STATUS=='不健康'){
                            health_status="attr bujiankang";
                        }
                        tableStr += "<tr><td title='"+list[i].GROUP_NAME+"'><span>" + list[i].GROUP_NAME + "</span></td>";
                        tableStr += "<td><span>" + list[i].ALL_COUNT + "</span></td>";
                        tableStr += "<td><span>" + list[i].EXECUTE_COUNT + "</span></td>";
                        tableStr += "<td><span>" + list[i].FAIL_COUNT + "</span></td>";
                        tableStr += "<td class='"+health_status+"'><span>" + list[i].HEALTH_STATUS + "</span></td></tr>";


                    }

                }

                $("#tb10").append(tableStr);


            }, error: function (textStatus) {
                console.log("error:" + textStatus.status);
            }
        });

}

function queryInspectOverviews(){
    url = ctx + "/KpiOverview/queryInspectOverview";
    $.ajax({
        url: url,
        type: "post",
        success: function (data) {

            var overview = JSON.parse(data);
            var overview=overview.tableData;
            console.log(overview);
            var xdata = [];
            var y1data = [];
            var y2data = [];
            var y3data = [];
            for (var i = 0; i < overview.length; i++) {
                xdata.push(overview[i].GROUP_NAME);
                y1data.push(overview[i].ALL_COUNT);
                y2data.push(overview[i].SUCCESS_COUNT);
                y3data.push(overview[i].FAIL_COUNT);
            }

            option = {
                backgroundColor: '#fff',//背景色
                tooltip: {
                    trigger: 'axis',
                    axisPointer : {
                        type : 'shadow'
                    },
                    formatter: function (params) {
                        return params[0].name + '<br/>'
                            + '总任务数:' + params[0].value + '<br/>'
                            + '成功数:' + params[1].value + '<br/>'
                            + '失败数:' + params[2].value + '';
                    }
                },
                /*title: {
                    text: '巡检任务执行情况',
                    x: 'center',
                    textStyle: {
                        color: '#fff'
                    }
                },*/
                toolbox: {
                    show: false,
                },
                grid: {
                    x: '10%',
                    y: '15%',
                    x2: '10%',
                    y2: '15%',
                    borderWidth: 0,
                },
                calculable: true,
                legend: {
                    data: ['总任务数', '成功数', '失败数'],
                    /*x: 'center',
                    y: 'bottom',*/
                    textStyle: {
                        color: '#AAAAAA'
                    }
                },
                xAxis: [
                    {
                        type: 'category',
                        splitLine: {
                            show: false,
                        },
                        axisLabel: {
                            show: true,
                            interval: 0,
                            rotate: -30,
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: xdata
                    }
                ],
                yAxis: [
                    {
                        type: 'value',
                        splitLine: {
                            show: true,
                        },
                        name: '',
                        axisLabel: {
                            formatter: '{value} ',
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    }
                ],
                series: [


                    {
                        name: '总任务数',
                        type: 'bar',
                        color: '#458B74',
                        label: {
                            normal: {
                                show: false,
                                position: 'insideRight'
                            }
                        },
                        data: y1data
                    },
                    {
                        name: '成功数',
                        type: 'bar',
                        color: '#32CD32',
                        stack: '总量',
                        label: {
                            normal: {
                                show: false,
                                position: 'insideRight'
                            }
                        },
                        data: y2data
                    },
                    {
                        name: '失败数',
                        type: 'bar',
                        color: '#FF3030',
                        stack: '总量',
                        label: {
                            normal: {
                                show: false,
                                position: 'insideRight'
                            }
                        },
                        data: y3data
                    }
                ]
            };


            center_right_echart.setOption(option);

        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });

}